google programming interview problem